package com.briup.web;

import com.briup.util.ResponseUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class LALToA {
    @GetMapping("/LALToA")
    public  ResponseUtil LALToA(String lat,String lng){
        String Url="https://way.jd.com/jisuapi/geoconvert?lat={lat}&lng={lng}&type=baidu&appkey=51d354810b136f5dc9a01a4260e4c6c3";
        RestTemplate restTemplate =new RestTemplate();
        ResponseEntity responseEntity =restTemplate.getForEntity(Url,String.class,lat,lng);
        String str = (String) responseEntity.getBody();
        ResponseUtil responseUtil = ResponseUtil.ok(str);
        return responseUtil;
    }
    }


